package com.mnsq.subject.controller;

import com.mnsq.subject.bean.condition.UserOperateCondition;
import com.mnsq.subject.service.UserOperaService;
import com.mnsq.user.bean.base.ThreadLocalInfo;
import com.mnsq.user.bean.dto.LoginInfo;
import com.vwkit.common.bean.Result;
import com.mnsq.common.bean.annotation.UserInfoRequired;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Administrator
 * @date 2019/4/24 0024
 */
@RestController
@RequestMapping("/api/opera")
public class UserOperaController {

    @Autowired
    private UserOperaService userOperaService;

    @ApiOperation("查询收藏、点赞等操作信息")
    @UserInfoRequired(required = true)
    @GetMapping("col/gre/info")
    public Result operationInfo(UserOperateCondition userOperateCondition) {
        LoginInfo loginInfo = ThreadLocalInfo.LOGIN_INFO.get();
        return userOperaService.queryUserOperationInfo(userOperateCondition.setUserId(loginInfo.getUserId()));
    }
}
